package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import cn.wolfcode.enums.BusinessReportEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;

@Getter
@Setter
public class BusinessReportQueryObject extends QueryObject {
    private String groupType =
     BusinessReportEnum.CONSUME.getValue();//分组类型,默认按门店
    private Long businessId;//门店id
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;//开始
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;//结束时间
    private Integer status;//结算单状态
    private Boolean ano;//预约类型


    public Date getEndDate() {

        if (endDate == null) {
            return null;
        }

        //一天的结束，结果：2017-03-01 23:59:59
        return DateUtil.endOfDay(endDate);
    }
}
